package com.zyx.mpdemo.controller;

import com.zyx.mpdemo.common.resp.CommonResponse;
import com.zyx.mpdemo.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author Yaxi.Zhang
 * @since 2023/2/22 11:09
 */
@Slf4j
@Controller
@ResponseBody
@RequestMapping("/user")
public class UserController {

    @Resource
    private IUserService userService;

    @PostMapping("/trans-async-query")
    public CommonResponse<Void> transAsyncQuery() {
        userService.transAsyncQuery();
        return CommonResponse.success(null, "执行成功");
    }

    @PostMapping("/trans-sync-query")
    public CommonResponse<Void> transSyncQuery() {
        userService.transSyncQuery();
        return CommonResponse.success(null, "执行成功");
    }

    @PostMapping("/sync-after-trans-query")
    public CommonResponse<Void> syncAfterTransQuery() {
        userService.syncAfterTransQuery();
        return CommonResponse.success(null, "执行成功");
    }

}
